package com.hkrt.demo.presentation.screen.main

import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.hkrt.demo.Const
import com.hkrt.demo.R
import com.hkrt.demo.presentation.base.BaseActivity
import kotlinx.android.synthetic.main.activity_main.*
import javax.inject.Inject

/**
 * @author  陈金广
 * @date 2018/4/10.
 */
@Route(path = Const.ROUTE_MAIN)
class MainActivity : BaseActivity<MainContract.View, MainContract.Presenter>() {

    @Autowired
    @JvmField
    var name: String? = null
    @Autowired
    @JvmField
    var age: Int? = 0

    @Inject
    lateinit var mainPresenter: MainPresenter

    override fun initLayoutId(): Int {
        return R.layout.activity_main
    }

    override fun initViewsAndEvents() {
        content.text = "name = $name, age = $age"
    }

    override fun injectDependencies() {
        activityComponent.inject(this)
    }

    override fun initPresenter(): MainContract.Presenter {
        return mainPresenter
    }
}